package de.fhluebeck.oop.gps.map;

import org.jdesktop.swingx.mapviewer.TileFactoryInfo;

/**
 * 
 * TileFactory, die URLs für Kartenstücke aus OpenStreetMaps erzeugt.
 * 
 * @author Ogün Bilge, Leif Hitzschke
 * @version 1.00, 13.11.2009
 * 
 */
public class GPSTileFactoryInfo extends TileFactoryInfo {

    private final static int maxZoomLevel = 17;

    public GPSTileFactoryInfo() {
        super(1, 5, maxZoomLevel, 256, true, true,
                "http://tile.openstreetmap.org",
                "x", "y", "z");

        setDefaultZoomLevel(2);
    }

    @Override
    public String getTileUrl(int x, int y, int zoom) {
        zoom = maxZoomLevel - zoom;
        return this.baseURL + "/" + zoom + "/" + x + "/" + y + ".png";
    }
}
